package com.sxwl.auth.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author reading
 * @Description TODO
 * @Date 2020/3/10 23:10
 */
@Service
public class MailService {
    @Autowired
    private JavaMailSender javaMailSender;
    public  void setJavaMailSender(Map<String,String> msg){
        SimpleMailMessage simpleMailMessage=new SimpleMailMessage();
        simpleMailMessage.setText(msg.get("code"));
        simpleMailMessage.setSubject("你的验证码是：");
        simpleMailMessage.setTo(msg.get("to"));
        simpleMailMessage.setFrom("3090974579@qq.com");
        javaMailSender.send(simpleMailMessage);
    }
}
